fix(fleet): preserve cli_version_sha across state writes and restore the sha-pin repin#393
Merged
Merged
Conversation
Signed-off-by: Joshua Temple <[email protected]>
…ites Signed-off-by: Joshua Temple <[email protected]>
Signed-off-by: Joshua Temple <[email protected]>
…tate-write-drop Signed-off-by: Joshua Temple <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A routine
chore: update state for <env> [skip ci]state-write dropped thecli_version_shafield from apin_mode: shamanifest, leaving SHA-pinnedsetup-clirefs with no manifest pin (permanent drift). Root cause: cascade binaries that predate the introduction of thecli_version_shastruct field discard the unmodeled YAML key on the orchestratewriteConfigtyped re-marshal. The node-surgeryWriteManifestStatepath (already onmain) is the correct fix and preserves the key even on a binary that never modeled it, so no production code change is required here.Fix
WriteManifestStatepreservescli_version_shaand the surrounding state wrapper.pin_mode: sharepo carrying a populatedcli_version_shathrough a routine dev state-write and asserts the manifest still declares the field, the generated workflows stay consistent, and regeneration is idempotent.pin_mode: shafleet repo again exercises SHA-pinning end-to-end. This is drift-safe now that repinned binaries carry the node-surgery state-write.Verification
go build ./...,go test ./...(full suite), andgolangci-lint run ./...all pass.main; the repin keeps the broadened stale-ref rewrite and the restored SHA-pin together, with the workaround removed.Closes #390.